home *** CD-ROM | disk | FTP | other *** search
/ Games Gallery 98 / Games Gallery 98 - Disc 1.iso / Content / BREAKIN / SETUP.SCR < prev    next >
Encoding:
Text File  |  1998-04-18  |  12.6 KB  |  305 lines

  1. //
  2. // Setup Installation File
  3. // Created by Setup Builder Version 5.02.001/32
  4. //
  5. // Copyright ⌐ 1993 - 1998 GPP Software
  6. //
  7. // Created: 19-04-1998 at 03:12:15
  8. //
  9. // Installation of RH Breakin 1.0 demo version.
  10.  
  11.  
  12. // Application Variables
  13. SET %Caption%="Setup"
  14. SET %Application%="RH Breakin"
  15. SET %Company%="Richard Hierro"
  16. SET %InstallPath%="c:\RHBreakin"
  17. SET %InstallDrive%=Left("%InstallPath%", 2)
  18. SET %Option%=1
  19. SET %Option1%=TRUE
  20. SET %IniFile%="Breakin.INI"
  21. SetSharedRegistry("%Company%", "%Application%", "%IniFile%")
  22. IF "#INSTVER#"=="INST16" GetProfileString("Install", "Path", "%InstallPath%", "%IniFile%", %InstallPath%)
  23. IF "#INSTVER#"=="INST32" RegGetSetting(2, "SOFTWARE\%Company%\%Application%\Install", "Path", "%InstallPath%", %InstallPath%)
  24. AddChar(%InstallPath%, "\")
  25. SET %InstallDrive%=Left("%InstallPath%", 2)
  26.  
  27.  
  28. // Language
  29. SetLanguage("UsEnglish")
  30.  
  31.  
  32. // Create all the objects
  33. CreateBackdrop("DEFAULTBACKDROP")
  34. CreateControl("Text","%Application% Setup",-1,20,10,0,0,1048576,"Times New Roman",50,3,16777215,0)
  35. CreateControl("Text","Install/De-Install created using Setup Builder Version 5.02.001/32|Copyright ⌐ 1993 - 1998 GPP Software|",-1,20,0,0,0,1114112,"Times New Roman",17,3,16777215,0)
  36. EndObject()
  37.  
  38.  
  39. // Close Setup Program
  40. HideSetup()
  41.  
  42.  
  43. // Display appropriate backdrop
  44. GetScreenWidth(%Width%)
  45. SET %BackDrop%="DEFAULTBACKDROP"
  46. IF "%BackDrop%" != "(None)" ShowBackdrop("%BackDrop%")
  47.  
  48.  
  49. // Determine if s/w is already installed
  50. SET %DoUpgrade% = FALSE
  51. IF "#INSTVER#"=="INST16" GetProfileString("Install", "DeInstallScript", "%InstallPath%DEINST.INF", "%IniFile%", %DeInstall%)
  52. IF "#INSTVER#"=="INST32" RegGetSetting(2, "SOFTWARE\%Company%\%Application%\Install", "DeInstallScript", "%InstallPath%DEINST.INF", %DeInstall%)
  53. IF "#INSTVER#"=="INST16" GetProfileString("Install", "Installed", "0", "%IniFile%", %Installed%)
  54. IF "#INSTVER#"=="INST32" RegGetInt(2, "SOFTWARE\%Company%\%Application%\Install", "Installed", 0, %Installed%)
  55. IF %Installed% != 0 GOTO :GOTVERSION
  56. SET %DoUpgrade% = TRUE
  57. SET %DeInstall% = "%InstallPath%DEINST.INF"
  58. CheckExists("%DeInstall%")
  59. SET %Installed% = %ERROR%
  60. IF %ERROR% == TRUE GOTO :GOTVERSION
  61. SET %DeInstall% = "%InstallPath%DEINST.SCR"
  62. CheckExists("%DeInstall%")
  63. SET %Installed% = %ERROR%
  64. IF %ERROR% == TRUE GOTO :GOTVERSION
  65. SET %DeInstall% = "%InstallPath%eBreakin.SCR"
  66. CheckExists("%DeInstall%")
  67. SET %Installed% = %ERROR%
  68. :GOTVERSION
  69.  
  70.  
  71. // Welcome Dialog
  72. :BACK1
  73. SET %Message1%="Welcome to the %Application% Installation Program."
  74. SET %Message2%="This program will install the %Application% software in the directory you specify on your hard disk."
  75. SET %Message3%="(Compuserve ID: 100105,536)||Setup is supplied with the Setup Builder|software and is the copyright of G.Plowman"
  76. DialogBox("Welcome")
  77. IF %ERROR% == IDCANCEL GOTO :EXIT
  78.  
  79.  
  80. // Sort out where to install the software
  81. // but only if the software isn't already installed
  82. AddChar(%InstallPath%, "\")
  83. SET %MakeDir% = %InstallPath%
  84. SET %Temp% = Len(%MakeDir%)
  85. IF %Temp% > 3 SET %Temp% = %Temp% - 1
  86. SET %MakeDir% = Left(%MakeDir%, %Temp%)
  87. IF %Installed% == TRUE GOTO :INSTALLED
  88.  
  89.  
  90. // Ask the user where to install the software
  91. // but only if the software isn't already installed
  92. :RETRY
  93. SET %Message1%="The install program will copy the %Application% files into the following directory:"
  94. DialogBox("AskPath")
  95. IF %ERROR% == IDBACK GOTO :BACK1
  96. IF %ERROR% == IDCANCEL GOTO :EXIT
  97.  
  98. // Create installation directory
  99. :INSTALLED
  100. SET %InstallDrive% = Left("%InstallPath%", 2)
  101. AddChar(%InstallPath%, "\")
  102. SET %MakeDir% = %InstallPath%
  103. SET %Temp% = Len(%MakeDir%)
  104. IF %Temp% > 3 SET %Temp% = %Temp% - 1
  105. SET %MakeDir% = Left(%MakeDir%, %Temp%)
  106. MkDir(%MakeDir%)
  107. IsWriteable(%MakeDir%)
  108. IF %ERROR% == FALSE GOTO :DIRERROR
  109.  
  110.  
  111. // Save the installation directory/de-install script
  112. IF "#INSTVER#"=="INST16" WriteProfileString("Install", "Path", "%MakeDir%", "%IniFile%")
  113. IF "#INSTVER#"=="INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Install", "Path", "%MakeDir%")
  114. SET %Temp% = ""
  115.  
  116.  
  117. // Upgrade the de-install if required
  118. IF %DoUpgrade% == FALSE GOTO :NODEINSTUPG
  119. SET %Temp% = "%DeInstall%"
  120. SET %DeInstall% = "%WindowsDirectory%GPPSOFT\eBreakin.001"
  121. GetBackupName("%DeInstall%", %DeInstall%)
  122. IF %Installed% == FALSE GOTO :NODEINSTUPG
  123. Open("%DeInstall%", 10, WRITE)
  124. WriteLine(10, "//$FILES$")
  125. Close(10)
  126. CopyFile("%Temp%","%DeInstall%",0,1,1)
  127. :NODEINSTUPG
  128.  
  129. SET %DoUpgrade% = ""
  130. IF "#INSTVER#"=="INST16" WriteProfileString("Install", "DeInstallScript", "%DeInstall%", "%IniFile%")
  131. IF "#INSTVER#"=="INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Install", "DeInstallScript", "%DeInstall%")
  132. IF "#INSTVER#"=="INST16" WriteProfileString("Install", "Installed", "1", "%IniFile%")
  133. IF "#INSTVER#"=="INST32" RegWriteInt(2, "SOFTWARE\%Company%\%Application%\Install", "Installed", 1)
  134.  
  135. WriteProfileString("%Application%", "Version", "1", "DEINST.INI")
  136. WriteProfileString("%Application%", "DeInstallScript", "%DeInstall%", "DEINST.INI")
  137. WriteProfileString("%Application%", "Cmd", "%WindowsDirectory%GPPSOFT\#INSTVER#.EXE", "DEINST.INI")
  138.  
  139.  
  140. SET %MakeDir% = ""
  141.  
  142.  
  143. // Decide whether an icon folder/icons is to be created
  144. MessageBox("Setup can create an Icon Folder for the %Application% application.||Do you wish to create an Icon Folder and icons ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  145. Set %PmGrp% = %Error%
  146.  
  147.  
  148. // Setup the de-install procedure
  149. OpenDeInstall("%DeInstall%")
  150. AddDeInstall("$STARTUP$","Set ^037IniFile^037=^034Breakin.INI^034")
  151. AddDeInstall("$STARTUP$","Set ^037Caption^037=^034Setup^034")
  152. AddDeInstall("$STARTUP$","Set ^037Application^037=^034RH Breakin^034")
  153. AddDeInstall("$STARTUP$","Set ^037Company^037=^034Richard Hierro^034")
  154. AddDeInstall("$STARTUP$","Set ^037InstallPath^037=^034%InstallPath%^034")
  155. AddDeInstall("$STARTUP$","Set ^037InstallDrive^037=^034%InstallDrive%^034")
  156. AddDeInstall("$STARTUP$","SetSharedRegistry(^034^037Company^037^034, ^034^037Application^037^034, ^034^037IniFile^037^034)")
  157. AddDeInstall("$STARTUP$","MessageBox(^034The %Application% software is about to be removed from your machine.^^013^^013All files, directories and the appropriate Icon Folder will be deleted.^^013^^013Are you sure you wish to continue ?^034, ^034%Caption%^034, MB_YESNO, MB_ICONQUESTION)")
  158. AddDeInstall("$STARTUP$","IF %%ERROR%% == IDYES GOTO :DODELETE")
  159. AddDeInstall("$STARTUP$","Set ^037Message1^037 = ^034De-installation aborted - the %Application% software has not been deinstalled.^034")
  160. AddDeInstall("$STARTUP$","Set ^037Message2^037 = ^034^034")
  161. AddDeInstall("$STARTUP$","DialogBox(^34OKBOX^34)")
  162. AddDeInstall("$STARTUP$","GOTO :END")
  163. AddDeInstall("$STARTUP$",":DODELETE")
  164.  
  165. // Cleanup de-install script
  166. AddDeInstall("$CLEANUP$","SET ^037Len^037 = Len(^034^037InstallPath^037^034) - 1")
  167. AddDeInstall("$CLEANUP$","SET ^037InstTemp^037 = Left(^034^037InstallPath^037^034, ^037Len^037)")
  168. AddDeInstall("$CLEANUP$","RmDir(^034^037InstTemp^037^034)")
  169. AddDeInstall("$CLEANUP$","Delete(^034%WindowsDirectory%%IniFile%^034)")
  170. AddDeInstall("$CLEANUP$","IF ^34^35^35INSTVER^35^35^34==^34INST32^34 RegDeleteSetting(2, ^34SOFTWARE\%Company%\%Application%^34, ^34^34)")
  171. AddDeInstall("$CLEANUP$","IF ^34^35^35INSTVER^35^35^34==^34INST32^34 RegDeleteSetting(3, ^34SOFTWARE\Microsoft\Windows\CurrentVersion\UnInstall\%Application%^34,^34^34)")
  172. AddDeInstall("$CLEANUP$","SET ^037Message1^037 = ^034The %Application% software has been successfully de-installed.^034")
  173. AddDeInstall("$CLEANUP$","SET ^037Message2^037 = ^034To re-install the %Application% software you should re-run the installation program.^034")
  174. AddDeInstall("$CLEANUP$","DialogBox(^34OKBOX^34)")
  175. AddDeInstall("$CLEANUP$","WriteProfileString(^34%Application%^34,^34Continue^34,^0341^34,^34DEINST.INI^34)")
  176. AddDeInstall("$CLEANUP$",":END")
  177.  
  178.  
  179. // Check for space availability
  180. GetDiskSpaceK(%InstallDrive%)
  181. SET %Space%=%ERROR%
  182. SET %Required%=1098
  183. IF %Space% >= %Required% GOTO :GOTSPACE
  184. MessageBox("The %Application% software requires %Required%K bytes of disk space and there is only %Space%K bytes free on your %InstallDrive% drive.||Do you wish to continue to install the software ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
  185. IF %ERROR% == IDNO GOTO :EXIT
  186. :GOTSPACE
  187.  
  188.  
  189. // Do the file copying
  190. SET %TotalBlocks%=15
  191. CopyFile(%TotalBlocks%)
  192. CheckExists("%CurrentDrive%DISK01", "Please insert the diskette labeled 'DISK01'")
  193. IF %ERROR% == IDCANCEL GOTO :EXIT
  194. AddDeInstall("$FILES$","Delete(^034%InstallPath%Breakin.ico^034)")
  195. "Breakin.ico", "%InstallPath%", "Copie:", TRUE
  196. AddDeInstall("$FILES$","Delete(^034%InstallPath%DebutFin.wav^034)")
  197. "DebutFin.wav", "%InstallPath%", "Copie:", TRUE
  198. AddDeInstall("$FILES$","Delete(^034%InstallPath%Destruction.wav^034)")
  199. "Destruction.wav", "%InstallPath%", "Copie:", TRUE
  200. AddDeInstall("$FILES$","Delete(^034%InstallPath%file_id.txt^034)")
  201. "file_id.txt", "%InstallPath%", "Copie:", TRUE
  202. AddDeInstall("$FILES$","Delete(^034%InstallPath%LisezMoi.txt^034)")
  203. "LisezMoi.txt", "%InstallPath%", "Copie:", TRUE
  204. AddDeInstall("$FILES$","Delete(^034%InstallPath%NssOrderForm.rtf^034)")
  205. "NssOrderForm.rtf", "%InstallPath%", "Copie:", TRUE
  206. AddDeInstall("$FILES$","Delete(^034%InstallPath%NssOrderForm.txt^034)")
  207. "NssOrderForm.txt", "%InstallPath%", "Copie:", TRUE
  208. AddDeInstall("$FILES$","Delete(^034%InstallPath%OrderForm.rtf^034)")
  209. "OrderForm.rtf", "%InstallPath%", "Copie:", TRUE
  210. AddDeInstall("$FILES$","Delete(^034%InstallPath%OrderForm.txt^034)")
  211. "OrderForm.txt", "%InstallPath%", "Copie:", TRUE
  212. AddDeInstall("$FILES$","Delete(^034%InstallPath%ReadMe.txt^034)")
  213. "ReadMe.txt", "%InstallPath%", "Copie:", TRUE
  214. AddDeInstall("$FILES$","Delete(^034%InstallPath%RHBreakin.exe^034)")
  215. "RHBreakin.exe", "%InstallPath%", "Copie:", TRUE
  216. AddDeInstall("$FILES$","Delete(^034%InstallPath%SOURCE.WAV^034)")
  217. "SOURCE.WAV", "%InstallPath%", "Copie:", TRUE
  218. AddDeInstall("$FILES$","Delete(^034%InstallPath%TOUCHE.WAV^034)")
  219. "TOUCHE.WAV", "%InstallPath%", "Copie:", TRUE
  220. AddDeInstall("$FILES$","Delete(^034%InstallPath%Vendor.doc^034)")
  221. "Vendor.doc", "%InstallPath%", "Copie:", TRUE
  222. SET %Skip%=0
  223. Release()
  224. SET %Skip%=1
  225. SetGaugeText("Copie:", "%CurrentDirectory%WING32.dll", "%SystemDirectory%WING32.dll")
  226. CheckExists("%SystemDirectory%WING32.dll")
  227. IF %ERROR% == TRUE GOTO :OVER1
  228. AddDeInstall("$FILES$","Delete(^034%SystemDirectory%WING32.dll^034)")
  229. "WING32.dll", "%SystemDirectory%", "Copie:", TRUE
  230. SET %Skip%=0
  231. :OVER1
  232. UpdateGauge(%Skip%)
  233. EndCopyFile()
  234. Release()
  235.  
  236.  
  237.  
  238.  
  239. // Now create the icon folder/icons
  240. IF %PmGrp% == IDYES THEN
  241. MakeGroup("%Application%", "")
  242. IF %Option% AND 1 != 0 MakeIcon("Read me!", "%InstallPath%ReadMe.txt", "")
  243. IF %Option% AND 1 != 0 MakeIcon("RH Breakin", "%InstallPath%RHBreakin.exe", "")
  244. AddDeInstall("$PMGROUP$","DeleteGroup(^034%Application%^034)")
  245. ENDIF
  246.  
  247.  
  248. // Create the de-install icon/control panel entry
  249. IF %PmGrp% != IDYES GOTO :NODEINSTICON
  250. IF "#INSTVER#" == "INST32" Skip(2)
  251. MakeIcon("Un-Install %Application%", "%WindowsDirectory%GPPSOFT\DEINST.EXE", "%Application%")
  252. Skip(5)
  253. IF "#WINVER#" >= "395" Skip(2)
  254. MakeIcon("Un-Install %Application%", "%WindowsDirectory%GPPSOFT\DEINST.EXE", "%Application%")
  255. Skip(2)
  256. RegWriteSetting(3, "SOFTWARE\Microsoft\Windows\CurrentVersion\UnInstall\%Application%", "DisplayName", "%Application%")
  257. RegWriteSetting(3, "SOFTWARE\Microsoft\Windows\CurrentVersion\UnInstall\%Application%", "UnInstallString", "%WindowsDirectory%GPPSOFT\DEINST.EXE %Application%")
  258. :NODEINSTICON
  259.  
  260.  
  261. // Done
  262. :SUCCESS
  263. SET %Message1%="|%Application% installation has been successfully completed."
  264. SET %Message2%=""
  265. DialogBox("OkBox")
  266.  
  267.  
  268. // User defined code - installation completion
  269. MessageBox("It is better to start again Windows to be sure the game works. Do you want start again  Windows now ?","Re-dΘmarrer Windows",  MB_YESNO, MB_ICONQUESTION)
  270. IF %ERROR% == IDYES  ExitWindows(TRUE)
  271. GOTO :END
  272.  
  273.  
  274. // User decided to quit
  275. :EXIT
  276. EndCopyFile()
  277. SET %Message1%="Installation has been terminated. You should re-run this installation program at a later time to install %Application%."
  278. SET %Message2%="|The %Application% software has not been installed."
  279. DialogBox("OkBox")
  280. GOTO :END
  281.  
  282.  
  283. // Error
  284. :ERROR
  285. EndCopyFile()
  286. SET %Message1%="An error occured during installation of the %Application% software."
  287. SET %Message2%="|The %Application% software has not been fully installed."
  288. DialogBox("OkBox")
  289. GOTO :END
  290.  
  291.  
  292. // Failed to create install directory
  293. :DIRERROR
  294. SET %Message1%="|Failed to create the installation directory '%MakeDir%'."
  295. SET %Message2%="|Unable to install the %Application% software in the specified directory."
  296. DialogBox("OkBox")
  297. GOTO :RETRY
  298.  
  299.  
  300. :END
  301. // Final tidy up - close files and remove components from H/D
  302. CloseDeInstall()
  303. Close()
  304. WinExec("%WindowsDirectory%GPPSOFT\CLEANUP.EXE")
  305.